#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include<QApplication>
#include<QFileDialog>
#include<QMainWindow>
#include<QMenuBar>
#include<QMessageBox>
#include<QWidget>
#include<QHBoxLayout>
#include<QVBoxLayout>
#include<QCloseEvent>

#include"Player.h"

class LeftPane;
class MetaDataDisplay;
// class Player;
class PlayerController;
class Playlist;
class PlaylistView;
class Scrobbler;
class StatusBar;
class SystemTrayIcon;


class MainWindow: public QMainWindow{
Q_OBJECT
public:
	MainWindow();
	~MainWindow();
protected:
	virtual void closeEvent( QCloseEvent *event );
private slots:
	void slotRequestedEditMetadata(QList<QString> songPaths);
//	void slotPlayerStateChanged(Player::State state);
	void slotQuit();
	void slotRestoreHide();
	void slotAddMedia();
	void slotConfigure();
	void slotPlaylistSave();
	void slotPlaylistLoad();
	void slotAbout();
	void slotAboutQt();
private:
	//Layout stuff...
	QVBoxLayout *m_layout;
	QWidget *m_widget;
	QHBoxLayout *m_topLayout;
	QWidget *m_topWidget;
	QHBoxLayout *m_displayLayout;
	QWidget *m_displayWidget;
	//Rest
	Player *m_player;
	PlayerController *m_playerController;
	LeftPane *m_leftPane;
	PlaylistView *m_playlistView;
	MetaDataDisplay *m_metaDataDisplay;
	SystemTrayIcon *m_systemTrayIcon;
	Scrobbler *m_scrobbler;
	QMenuBar *m_menuBar;
	//Actions
	QAction *m_actionQuit;
	QAction *m_actionPrev;
	QAction *m_actionNext;
	QAction *m_actionStop;
	QAction *m_actionPlayPause;
	QAction *m_actionRestoreHide;
	QAction *m_actionAddMedia;
	QAction *m_actionStopAfterCurrent;
	QAction *m_actionConfigure;
	QAction *m_actionPlaylistSave;
	QAction *m_actionPlaylistLoad;
	QAction *m_actionAbout;
	QAction *m_actionAboutQt;
	
	void _initPlayerController();
	void _initScrobbler();
	void _initFileSystemView();
	void _initMetaDataDisplay();
	void _initPlaylistView();
	void _initActions();
	void _initSystemTray();
	void _initMenuBar();
	void _initSignalsAndSlots();
};

#endif
